package com.wwwarehouse.dubbo;

import com.alibaba.dubbo.config.annotation.Service;
import com.wwwarehouse.commons.dubbo.DubboContextUtil;
import lombok.extern.slf4j.Slf4j;

import java.util.Collection;
import java.util.HashMap;

@Service
@Slf4j
public class TestApiImpl implements TestApi {
    @Override
    public void httpTest(String param1) {

    }

    @Override
    public void normal(String param1, long param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal2(Collection<String> param1, HashMap<String, String> param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal3(Model<SubModel> param1, long param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal4(Collection<HashMap<String, String>> param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal5(Collection<Model<String>> param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal6(Collection<Model<SubModel>> param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal7(Collection<SubModel> param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal8(GenericModel param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }

    @Override
    public void normal9(Collection<Collection<String>> param1, EnumNormal param2) {
        log.info("{}", DubboContextUtil.getContextUtil().getAttachment("traceId"));
        log.info("{}, {}", param1, param2);
    }
}
